{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# pandas\n",
    "\n",
    "| Function                                                                                                                                                                                                                              | Chapter                                      | Description                                                                                                                                                                                                                                                                                                                                                         |\n",
    "| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n",
    "| [`pd.DataFrame(data)`](https://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.html)                                                                                                                                  | Tabular Data and pandas                      | Create a DataFrame from a two-dimensional array or dictionary `data`                                                                                                                                                                                                                                                                                                |\n",
    "| [`pd.read_csv(filepath)`](https://pandas.pydata.org/pandas-docs/stable/generated/pandas.read_csv.html)                                                                                                                                | Tabular Data and pandas                      | Import a CSV file from `filepath` as a pandas DataFrame                                                                                                                                                                                                                                                                                                             |\n",
    "| [`pd.DataFrame.head(n=5)`](https://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.head.html)<br/>[`pd.Series.head(n=5)`](https://pandas.pydata.org/pandas-docs/stable/generated/pandas.Series.head.html)             | Tabular Data and pandas                      | View the first `n` rows of a DataFrame or Series                                                                                                                                                                                                                                                                                                                    |\n",
    "| `pd.DataFrame.index`<br/>`pd.DataFrame.columns`                                                                                                                                                                                       | Tabular Data and pandas                      | View a DataFrame's index and column values                                                                                                                                                                                                                                                                                                                          |\n",
    "| [`pd.DataFrame.describe()`](https://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.describe.html)<br/>[`pd.Series.describe()`](https://pandas.pydata.org/pandas-docs/stable/generated/pandas.Series.describe.html)   | Exploratory Data Analysis                    | View descriptive statistics about a DataFrame or Series                                                                                                                                                                                                                                                                                                              |\n",
    "| [`pd.Series.unique()`](https://pandas.pydata.org/pandas-docs/stable/generated/pandas.Series.unique.html)                                                                                                                              | Exploratory Data Analysis                    | View unique values in a Series                                                                                                                                                                                                                                                                                                                                      |\n",
    "| [`pd.Series.value_counts()`](https://pandas.pydata.org/pandas-docs/stable/generated/pandas.Series.value_counts.html)                                                                                                                  | Exploratory Data Analysis                    | View the number of times each unique value appears in a Series                                                                                                                                                                                                                                                                                                      |\n",
    "| `df[col]`                                                                                                                                                                                                                             | Tabular Data and pandas                      | From DataFrame `df`, return column `col` as a Series                                                                                                                                                                                                                                                                                                                |\n",
    "| `df[[col]]`                                                                                                                                                                                                                           | Tabular Data and pandas                      | From DataFrame `df`, return column `col` as a DataFrame                                                                                                                                                                                                                                                                                                             |\n",
    "| `df.loc[row, col]`                                                                                                                                                                                                                    | Tabular Data and pandas                      | From DataFrame `df`, return rows with index name `row` and column name `col`; `row` can alternatively be a boolean Series                                                                                                                                                                                                                                           |\n",
    "| `df.iloc[row, col]`                                                                                                                                                                                                                   | Tabular Data and pandas                      | From DataFrame `df`, return rows with index number `row` and column number `col`; `row` can alternatively be a boolean Series                                                                                                                                                                                                                                       |\n",
    "| [`pd.DataFrame.isnull()`](https://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.isnull.html)<br/>[`pd.Series.isnull()`](https://pandas.pydata.org/pandas-docs/stable/generated/pandas.Series.isnull.html)           | Data Cleaning                                | View missing values in a DataFrame or Series                                                                                                                                                                                                                                                                                                                        |\n",
    "| [`pd.DataFrame.fillna(value)`](https://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.fillna.html)<br/>[`pd.Series.fillna(value)`](https://pandas.pydata.org/pandas-docs/stable/generated/pandas.Series.fillna.html) | Data Cleaning                                | Fill in missing values in a DataFrame or Series with `value`                                                                                                                                                                                                                                                                                                        |\n",
    "| [`pd.DataFrame.dropna(axis)`](https://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.dropna.html)<br/>[`pd.Series.dropna()`](https://pandas.pydata.org/pandas-docs/stable/generated/pandas.Series.dropna.html)       | Data Cleaning                                | Drop rows or columns with missing values from a DataFrame or Series                                                                                                                                                                                                                                                                                                 |\n",
    "| [`pd.DataFrame.drop(labels, axis)`](https://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.drop.html)                                                                                                                | Data Cleaning                                | Drop rows or columns named `labels` from DataFrame along `axis`                                                                                                                                                                                                                                                                                                     |\n",
    "| [`pd.DataFrame.rename()`](https://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.rename.html)                                                                                                                        | Data Cleaning                                | Rename specified rows or column in DataFrame                                                                                                                                                                                                                                                                                                                        |\n",
    "| [`pd.DataFrame.replace(to_replace, value)`](https://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.replace.html)                                                                                                     | Data Cleaning                                | Replace `to_replace` values with `value` in DataFrame                                                                                                                                                                                                                                                                                                               |\n",
    "| [`pd.DataFrame.reset_index(drop=False)`](https://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.reset_index.html)                                                                                                    | Data Cleaning                                | Reset a DataFrame's indices; by default, retains old indices as a new column unless `drop=True` specified                                                                                                                                                                                                                                                           |\n",
    "| [`pd.DataFrame.sort_values(by, ascending=True)`](https://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.sort_values.html)                                                                                            | Tabular Data and pandas                      | Sort a DataFrame by specified columns `by`, in ascending order by default                                                                                                                                                                                                                                                                                           |\n",
    "| [`pd.DataFrame.groupby(by)`](https://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.groupby.html)                                                                                                                    | Tabular Data and pandas                      | Return a GroupBy object that contains a DataFrame grouped by the values in the specified columns `by`                                                                                                                                                                                                                                                               |\n",
    "| [`GroupBy.<function>`](https://pandas.pydata.org/pandas-docs/stable/api.html#id41)                                                                                                                                                    | Tabular Data and pandas                      | Apply a function `<function>` to each group in a GroupBy object `GroupBy`; e.g. [`mean()`](https://pandas.pydata.org/pandas-docs/stable/generated/pandas.core.groupby.GroupBy.mean.html), [`count()`](https://pandas.pydata.org/pandas-docs/stable/generated/pandas.core.groupby.GroupBy.count.html)                                                                |\n",
    "| [`pd.Series.<function>`](https://pandas.pydata.org/pandas-docs/stable/api.html#computations-descriptive-stats)                                                                                                                        | Tabular Data and pandas                      | Apply a function `<function>` to a Series with numerical values; e.g. [`mean()`](https://pandas.pydata.org/pandas-docs/stable/generated/pandas.Series.mean.html), [`max()`](https://pandas.pydata.org/pandas-docs/stable/generated/pandas.Series.max.html), [`median()`](https://pandas.pydata.org/pandas-docs/stable/generated/pandas.Series.median.html)          |\n",
    "| [`pd.Series.str.<function>`](https://pandas.pydata.org/pandas-docs/stable/api.html#string-handling)                                                                                                                                   | Tabular Data and pandas                      | Apply a function `<function>` to a Series with string values; e.g. [`len()`](https://pandas.pydata.org/pandas-docs/stable/generated/pandas.Series.str.len.html), [`lower()`](https://pandas.pydata.org/pandas-docs/stable/generated/pandas.Series.str.lower.html), [`split()`](https://pandas.pydata.org/pandas-docs/stable/generated/pandas.Series.str.split.html) |\n",
    "| [`pd.Series.dt.<property>`](https://pandas.pydata.org/pandas-docs/stable/api.html#datetimelike-properties)                                                                                                                            | Tabular Data and pandas                      | Extract a property `<property>` from a Series with Datetime values; e.g. [`year`](https://pandas.pydata.org/pandas-docs/stable/generated/pandas.Series.dt.year.html), [`month`](https://pandas.pydata.org/pandas-docs/stable/generated/pandas.Series.dt.month.html), [`date`](https://pandas.pydata.org/pandas-docs/stable/generated/pandas.Series.dt.date.html)    |\n",
    "| [`pd.get_dummies(columns, drop_first=False)`](https://pandas.pydata.org/pandas-docs/stable/generated/pandas.get_dummies.html)                                                                                                         | ---                                          | Convert categorical variables `columns` to dummy variables; default retains all variables unless `drop_first=True` specified                                                                                                                                                                                                                                        |\n",
    "| [`pd.merge(left, right, how, on)`](https://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.merge.html)                                                                                                                | Exploratory Data Analysis; Databases and SQL | Merge two DataFrames `left` and `right` together on specified columns `on`; type of join depends on `how`                                                                                                                                                                                                                                                           |\n",
    "| [`pd.read_sql(sql, con)`](https://pandas.pydata.org/pandas-docs/stable/generated/pandas.read_sql.html)                                                                                                                                | Databases and SQL                            | Read a SQL query `sql` on a database connection `con`, and return result as a pandas DataFrame                                                                                                                                                                                                                                                                      |\n"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
